<template>
  <div>
 <div class="Searchlist">
  <van-icon name="arrow-left"  @click="fnn" />
    <van-search
  v-model="value"
  shape="round"
  background="#4fc08d"
  placeholder="请输入搜索关键词"
  @click="fn"
/>
  
 </div> 
<!-- $store.state.ii?$store.state.ii:value1 -->
<div  >
    <van-card v-for=" item in  $store.state.ii" :key="item.id"

  :price="item.price"
  :desc="item.dsec3"
  :title="item.name"
  :thumb="item.url"
/>
<div>
  <van-card v-for=" item in $store.state.ii?$store.state.ii: value1" :key="item.id"

:price="item.price"
:desc="item.dsec3"
:title="item.name"
:thumb="item.url"
/>
</div>
<div>
  <van-card v-for=" item in $store.state.ii?$store.state.ii: value1" :key="item.id"

:price="item.price"
:desc="item.dsec3"
:title="item.name"
:thumb="item.url"
/>
</div>
<div>
  <van-card v-for=" item in $store.state.ii?$store.state.ii: value1" :key="item.id"

:price="item.price"
:desc="item.dsec3"
:title="item.name"
:thumb="item.url"
/>
</div>
</div>
  </div>
</template>

<script>
import { Search } from "@/api";
export default {
  async created() {
    const data = await Search();
    console.log(data);
    this.value1 = data.data.search;
  },
  data() {
    return {
      value: "",
      value1: [],
    };
    //
  },
  methods: {
    fn() {
      this.$router.push({ path: "/Search" });
    },
    fnn(){
      this.$router.push({ path: "/Search" });
    }
  },
};
//启动项目
</script>

<style lang="less" scoped>
.van-card {
  margin: 10px 0 0 0;
}
.van-card {
  background-color: rgb(79, 192, 141);
  width: 98%;
  margin: 10px auto;
  border-radius: 5px;
}
.Searchlist{
  display: flex;
  background-color: rgb(79, 192, 141);
  .van-icon{
   width:5%;
   line-height:54px ;
   font-size: 20px;
 
  padding: 0 0 0 10px;
  margin: 0;
  }
  .van-search{
    width: 90%;
  }
}
</style>